<?php

namespace Respect\Http\Module;

use Respect\Http\Bootstrappable;
use Respect\Environment\EnvironmentableInterface;
use ArrayObject;

class Put extends ArrayObject implements Bootstrappable
{

    public static function qualify(EnvironmentableInterface $env)
    {
        return $env('REQUEST_METHOD') === 'PUT' ? new static($env) : false;
    }

    public function __construct(EnvironmentableInterface $env)
    {
        parse_str(file_get_contents('php://input'), $putData);
        parent::__construct($putData);
    }

}